<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>

<%@ page import="com.course.daoImpl.CourseDaoImpl"%>
<%@ page import="com.course.bean.CourseTo"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
  <head>
   

  </head>
  
  <body>
  <jsp:include page="Header.jsp"></jsp:include><br/>
  
  
   <table align="center">
			<tr>
				<td colspan="1" width="" height="" valign="top"><img src="<%=request.getContextPath()+"/images/d3.jpg"%>" align="top" height="75" width="150"/></td>
			</tr>
			</table>
  <%  
     String path=request.getRealPath("/document"); 
      System.out.println(path+"@@@@@@@@@@@@@@@&quot"); 
     
 int cid=Integer.parseInt(request.getParameter("courseid"));
 
     CourseDaoImpl profiledao=new CourseDaoImpl();
    Vector<CourseTo> vcb=profiledao.viewMaterial(path,cid); 
int cnt=0; 
for(CourseTo doc:vcb) 
{ 
    cnt++; 
   String doc1= doc.getMaterial(); 
   int id= doc.getMid(); 
   System.out.println(doc1+"##############"+id); 
%>
<%
//response.setContentType("application/doc");
//response.setHeader("Content-disposition","attachment; filename="+cnt+doc1);
 %>
  
                 
 
<a href='<%=path+'/'+id+doc1%>'>Open Document</a>
 
<%

out.println("<br>");

}
 %>
 <br/>
 <br/>
  <jsp:include page="Footer.jsp"></jsp:include>
  </body>
</html>
